package com.yqya.springboot.hello.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/**
 * 测试示例
 *
 * @author Kevin
 * @date 2019-07-28
 */
@Api(value = "类注解")
@RestController
public class HelloController {

    @GetMapping("/")
    public String index() {
        String result = "专业，通往中产阶级的生存之道";
        return result;
    }

    @ApiOperation(value = "方法注解", notes = "hello")
    @GetMapping("/hello")
    public String hello(@ApiParam(value = "参数注解", required = true) @RequestParam String name) {
        String result = "hello " + name;
        return result;
    }

}
